/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exercises.day02.pt03;

import java.util.ArrayList;

/**
 *
 * @author Student
 */
public class BankCustomer {

    private String address;
    private String type;
    private double income;
    private String phone;
    private String splitWords[];
    private String id;
    private String fname;
    private String lname;

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getFname() {
        return fname;
    }

    public void setFname(String fname) {
        this.fname = fname;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public double getIncome() {
        return income;
    }

    public void setIncome(double income) {
        this.income = income;
    }

    public String getLname() {
        return lname;
    }

    public void setLname(String lname) {
        this.lname = lname;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String[] getSplitWords() {
        return splitWords;
    }

    public void setSplitWords(String[] splitWords) {
        this.splitWords = splitWords;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "BankCustomer{" + "id=" + id + ", fname=" + fname + ", lname=" + lname + ", address=" + address + ", type=" + type + ", income=" + income + ", phone=" + phone + '}';
    }



    public BankCustomer(String id,  String lname,String fname, String address, String type, double income, String phone) {
        this.id = id;
        this.fname = fname;
        this.lname = lname;
        this.address = address;
        this.type = type;
        this.income = income;
        this.phone = phone;
    }

    public BankCustomer(String details) {

        splitWords = details.split(",");

        this.id = splitWords[0];
        this.fname = splitWords[1];
        this.lname = splitWords[2];
        this.address = splitWords[3];
        this.type = splitWords[4];
        this.income = Double.parseDouble(splitWords[5]);
        this.phone = splitWords[6];

    }
}
